package rladidxo.basic;

public class Ex72_OOP {
public static void main(String[] args) {
	Ex72_Retangle ret = new Ex72_Retangle();
	Ex73_Fan fan = new Ex73_Fan();
	Ex74_Account account = new Ex74_Account();
	Ex75_Stock stock = new Ex75_Stock();
	
	ret = new Ex72_Retangle(20, 30, "yellow");
	ret.width=4;
	ret.hight=40;
	ret.color="red";
	
	System.out.println("넓이는"+ret.getArea()+"/둘레는"+ret.getCircum());System.out.println();
	System.out.println(ret.width*ret.hight+"/"+ret.color);
	System.out.println("------------------------------------");
	
	fan.speed = fan.FAST;
	fan.color = "yellow";
	fan.radius = 10;
	fan.on = true;
	System.out.println(fan.radius+"/"+fan.color+"/"+fan.speed+"/"+fan.on);
	System.out.println("------------------------------------");
	
	account.aid = 1122;
	account.balance = 20000;
	account.interestRate = 4.5;
	account.dateCreated = "2014-08-15 14:34:29";
	System.out.println(account.aid+"/"+account.balance+"/"+account.interestRate+"/"+account.dateCreated);
	System.out.println("------------------------------------");
	
	stock.sname = "종목명'경영기술'";
	stock.previousClosingPrice = 100;
	stock.currentPrice = 75;
	System.out.println(stock.sname+"/종가 "+stock.previousClosingPrice+"만원/현재가 "+stock.currentPrice+"만원");
	
	
}//main
}//class

	

class Ex72_Retangle{
	double circum;
	double area;
	double hight;
	double width;
	String color;
	public Ex72_Retangle() {
		hight=1.0;
		width=1.0;
		color = "white";
	}
	public Ex72_Retangle(double hight, double width, String color){
		this.width=width;
		this.hight=hight;
		this.color=color;
	}//사용자 정의 생성자
	double getArea(){
		area = hight*width;
				return area;
}
	double getCircum(){
		circum = 2*hight+2*width;
		return circum;
	}
}//Retangle
class Ex73_Fan{
	final int SLOW = 1;
	final int MEDIUM = 2;
	final int FAST = 3;
	int speed = SLOW;
	boolean on = false;
	double radius = 5.0;
	String color = "blue";
	
	
}//Fan
class Ex74_Account{
	int aid;
	int balance;
	double interestRate;
	String dateCreated;
	public Ex74_Account() {
		aid = 0;
		balance = 0;
		interestRate = 0;
		
	}
	
}//Account
class Ex75_Stock{
	String sname ;
	int previousClosingPrice;
	int currentPrice ;
	public Ex75_Stock() {
	
	}
}//Stock